import request from '@/utils/http.js'


// 查询品牌和分类关联关系
export const getBrandCategoryApi = (brandId) => {
  return request({
    url: 'pms/backend/brandRelate/list',
    method: "GET",
    params: {
      brandId
    }
  })
}

// 保存品牌和分类关联关系
export const saveBrandCategoryApi = (data) => {
  return request({
    url: "pms/backend/brandRelate/save",
    method: "POST",
    data: JSON.stringify(data),
  })
}

// 删除品牌和分类关联关系
export const deleteBrandCategoryApi = (id) => {
  return request({
    url: `pms/backend/brandRelate/delete/${id}`,
    method: "DELETE",
  })
}

// 根据分类id获取品牌集合
export const getBrandByCategoryIdApi = (categoryId) => {
  return request({
    url: 'pms/backend/brandRelate/brandList',
    method: "GET",
    params: {
      categoryId,
    }
  })
}